package edu.ynu.se.xiecheng.achitectureclass.auth.filter;

import org.apache.shiro.web.filter.authc.AnonymousFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

public class Knife4jFilter extends AnonymousFilter {
    private static final Logger logger = LoggerFactory.getLogger(Knife4jFilter.class);
    
    @Override
    protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) {
        HttpServletRequest httpRequest = (HttpServletRequest) request;
        String uri = httpRequest.getRequestURI();
        logger.debug("Knife4j request: {}", uri);
        return true;
    }
} 